import { RouteRecordRaw, RouterView } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/ai-app',
    component: RouterView,
    meta: { title: 'AI应用' },
    redirect: '/ai-app/app-overview',
    children: [
      {
        path: '/ai-app/app-overview',
        component: () => import('@/views/online-lab/ai-app/app-overview/index.vue'),
        meta: { title: '应用概览' }
      },
      {
        path: '/ai-app/app-list',
        component: RouterView,
        meta: { title: '应用仓库' },
        redirect: '/ai-app/app-list/list',
        children: [
          {
            path: '/ai-app/app-list/list',
            component: () => import('@/views/online-lab/ai-app/app-list/list/index.vue'),
            meta: { title: '应用列表' }
          },
          {
            path: '/ai-app/app-list/:type',
            component: () => import('@/views/online-lab/ai-app/app-list/edit/index.vue')
          },
          {
            path: '/ai-app/app-list/detail/:id',
            component: () => import('@/views/online-lab/ai-app/app-list/detail/index.vue'),
            meta: { title: '应用详情' }
          }
        ]
      },
      {
        path: '/ai-app/app-record',
        component: () => import('@/views/online-lab/ai-app/app-record/index.vue')
      },
      {
        path: '/ai-app/check-log',
        redirect: '/ai-app/check-log/list',
        children: [
          {
            path: '/ai-app/check-log/list',
            component: () => import('@/views/online-lab/ai-app/check-log/list/index.vue'),
            meta: { title: '审核记录' }
          },
          {
            path: '/ai-app/check-log/detail/:id',
            component: () => import('@/views/online-lab/ai-app/check-log/detail/index.vue'),
            meta: { title: '审核详情' }
          }
        ]
      }
    ]
  }
]

export default routes
